<?php
$countryString = "AFGHANISTAN
ALBANIA
ALGERIA
AMERICAN SAMOA
ANDORRA
ANGOLA
ANGUILLA
ANTARCTICA
ANTIGUA AND BARBUDA
ARGENTINA
ARMENIA
ARUBA
AUSTRALIA
AUSTRIA
AZERBAIJAN
BAHAMAS
BAHRAIN
BANGLADESH
BARBADOS
BELARUS
BELGIUM
BELIZE
BENIN
BERMUDA
BHUTAN
BOLIVIA
BOSNIA AND HERZEGOWINA
BOTSWANA
BOUVET ISLAND
BRAZIL
BRITISH INDIAN OCEAN TERRITORY
BRUNEI DARUSSALAM
BULGARIA
BURKINA FASO
BURUNDI
CAMBODIA
CAMEROON
CANADA
CAPE VERDE
CAYMAN ISLANDS
CENTRAL AFRICAN REPUBLIC
CHAD
CHILE
CHINA
CHRISTMAS ISLAND
COCOS (KEELING) ISLANDS
COLOMBIA
COMOROS
CONGO
CONGO, THE DRC
COOK ISLANDS
COSTA RICA
COTE D'IVOIRE
CROATIA (local name: Hrvatska)
CUBA
CYPRUS
CZECH REPUBLIC
DENMARK
DJIBOUTI
DOMINICA
DOMINICAN REPUBLIC
EAST TIMOR
ECUADOR
EGYPT
EL SALVADOR
EQUATORIAL GUINEA
ERITREA
ESTONIA
ETHIOPIA
FALKLAND ISLANDS (MALVINAS)
FAROE ISLANDS
FIJI
FINLAND
FRANCE
FRANCE, METROPOLITAN
FRENCH GUIANA
FRENCH POLYNESIA
FRENCH SOUTHERN TERRITORIES
GABON
GAMBIA
GEORGIA
GERMANY
GHANA
GIBRALTAR
GREECE
GREENLAND
GRENADA
GUADELOUPE
GUAM
GUATEMALA
GUINEA
GUINEA-BISSAU
GUYANA
HAITI
HEARD AND MC DONALD ISLANDS
HOLY SEE (VATICAN CITY STATE)
HONDURAS
HONG KONG
HUNGARY
ICELAND
INDIA
INDONESIA
IRAN (ISLAMIC REPUBLIC OF)
IRAQ
IRELAND
ISRAEL
ITALY
JAMAICA
JAPAN
JORDAN
KAZAKHSTAN
KENYA
KIRIBATI
KOREA, D.P.R.O.
KOREA, REPUBLIC OF
KUWAIT
KYRGYZSTAN
LAOS 
LATVIA
LEBANON
LESOTHO
LIBERIA
LIBYAN ARAB JAMAHIRIYA
LIECHTENSTEIN
LITHUANIA
LUXEMBOURG
MACAU
MACEDONIA
MADAGASCAR
MALAWI
MALAYSIA
MALDIVES
MALI
MALTA
MARSHALL ISLANDS
MARTINIQUE
MAURITANIA
MAURITIUS
MAYOTTE
MEXICO
MICRONESIA, FEDERATED STATES OF
MOLDOVA, REPUBLIC OF
MONACO
MONGOLIA
MONTSERRAT
MOROCCO
MOZAMBIQUE
MYANMAR (Burma) 
NAMIBIA
NAURU
NEPAL
NETHERLANDS
NETHERLANDS ANTILLES
NEW CALEDONIA
NEW ZEALAND
NICARAGUA
NIGER
NIGERIA
NIUE
NORFOLK ISLAND
NORTHERN MARIANA ISLANDS
NORWAY
OMAN
PAKISTAN
PALAU
PANAMA
PAPUA NEW GUINEA
PARAGUAY
PERU
PHILIPPINES
PITCAIRN
POLAND
PORTUGAL
PUERTO RICO
QATAR
REUNION
ROMANIA
RUSSIAN FEDERATION
RWANDA
SAINT KITTS AND NEVIS
SAINT LUCIA
SAINT VINCENT AND THE GRENADINES
SAMOA
SAN MARINO
SAO TOME AND PRINCIPE
SAUDI ARABIA
SENEGAL
SEYCHELLES
SIERRA LEONE
SINGAPORE
SLOVAKIA (Slovak Republic)
SLOVENIA
SOLOMON ISLANDS
SOMALIA
SOUTH AFRICA
SOUTH GEORGIA AND SOUTH S.S.
SPAIN
SRI LANKA
ST. HELENA
ST. PIERRE AND MIQUELON
SUDAN
SURINAME
SVALBARD AND JAN MAYEN ISLANDS
SWAZILAND
SWEDEN
SWITZERLAND
SYRIAN ARAB REPUBLIC
TAIWAN, PROVINCE OF CHINA
TAJIKISTAN
TANZANIA, UNITED REPUBLIC OF
THAILAND
TOGO
TOKELAU
TONGA
TRINIDAD AND TOBAGO
TUNISIA
TURKEY
TURKMENISTAN
TURKS AND CAICOS ISLANDS
TUVALU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BGD
BRB
BLR
BEL
BLZ
BEN
BMU
BTN
BOL
BIH
BWA
BVT
BRA
IOT
BRN
BGR
BFA
BDI
KHM
CMR
CAN
CPV
CYM
CAF
TCD
CHL
CHN
CXR
CCK
COL
COM
COG
COD
COK
CRI
CIV
HRV
CUB
CYP
CZE
DNK
DJI
DMA
DOM
TMP
ECU
EGY
SLV
GNQ
ERI
EST
ETH 
FLK
FRO
FJI
FIN
FRA
FXX
GUF
PYF
ATF
GAB
GMB
GEO
DEU
GHA
GIB
GRC
GRL
GRD
GLP
GUM
GTM
GIN
GNB
GUY
HTI
HMD
VAT
HND
HKG
HUN
ISL
IND
IDN
IRN
IRQ
IRL
ISR
ITA
JAM
JPN
JOR
KAZ
KEN
KIR
PRK
KOR
KWT
KGZ
LAO
LVA
LBN
LSO
LBR
LBY
LIE
LTU
LUX
MAC
MKD
MDG
MWI
MYS
MDV
MLI
MLT
MHL
MTQ
MRT
MUS
MYT
MEX
FSM
MDA
MCO
MNG
MSR
MAR
MOZ
MMR
NAM
NRU
NPL
NLD
ANT
NCL
NZL
NIC
NER
NGA
NIU
NFK
MNP
NOR
OMN
PAK
PLW
PAN
PNG
PRY
PER
PHL
PCN
POL
PRT
PRI
QAT
REU
ROM
RUS
RWA
KNA
LCA
VCT
WSM
SMR
STP
SAU
SEN
SYC
SLE
SGP
SVK
SVN
SLB
SOM
ZAF
SGS
ESP
LKA
SHN
SPM
SDN
SUR
SJM
SWZ
SWE
CHE
SYR
TWN
TJK
TZA
THA
TGO
TKL
TON
TTO
TUN
TUR
TKM
TCA
TUV
UGA
UKR
ARE
GBR
USA
UMI
URY
UZB
VUT
VEN
VNM
VGB
VIR
WLF
ESH
YEM
ZMB
ZWE";
if (!strcasecmp('ISRAEL', 'Israel')){
	echo 'True<br />';
}
if (!strcmp(strtolower('ISRAEL'), strtolower('Israel'))){
	echo 'True<br />';
}
$countryIdentifiers = Array();
require_once 'class/config.php';
$database = DataBase::getInstance();

$separator = $countryIdentifierA2[2] . $countryIdentifierA2[3];
$countryIdentifiers['countryIdentifier'] = explode($separator, $countryIdentifierA2);
$countryIdentifiers['countryName'] = explode($separator, $countryString);

$i = 0;
foreach ($countryIdentifiers['countryIdentifier'] as $identifier){
	echo 'country id = ' . $countryIdentifiers['countryIdentifier'][$i];
	echo ' and country name = ' . $countryIdentifiers['countryName'][$i] . '<br />';
	$database->insertCountryIdentifier($countryIdentifiers['countryIdentifier'][$i], $countryIdentifiers['countryName'][$i]);
	$i++;
}
echo ord($countryIdentifierA2[12]);
echo '<pre>';
var_dump($countryIdentifiers);
echo '<pre>';